<template>
	<view class="wanl-list">		

		<!-- 主体 -->
		
		<view class="wanl-product">
			<view class="product_warter col-2-20">
				<view class="wanl-waterfall">
					<view id="wanl-left-cloumn" class="wanl-cloumn">
						<view class="warter left" v-for="(item, index) in goodsData" :key="index" style="height:540rpx;width: 48%;float: left;"  @tap="$wanlshop.to(`/pages/user2/partner/goods?id=${item.goods_id}&pid=${item.id}`)">
							<view class="img-wrap">
								<image class="image" :src="$wanlshop.oss(item.image,0,150)"  style="height: 340rpx;width: 340rpx;"></image>
							</view>
							<view class="content padding-bj">								
								<text>{{ item.title }}</text>
								<view class="flex align-center justify-between">
									<block>
										<view class="text-red text-bold text-lg">
											<text class="text-price">{{item.price}}</text>
										</view>								
									</block>
								
								</view>
							</view>
						</view>
					</view>					
				</view>
			</view>			
		</view>
		

		<block v-if="goodsData.length === 0 && status !== 'loading'">
			<wanl-empty :text="empty"/>
		</block>		
	
		<view class="edgeInsetBottom"></view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			WanlScroll: 0, //记录页面滚动
			scrollStype: false, //滚动状态
			filterIndex: 0, //
			priceOrder: 0, //1 价格从低到高 2价格从高到低
			liststyle: 'col-2-20', //列表样式
			goodsData: [], //商品列表数据
			
			goodsType: 'goods',
			empty: '没有找到任何宝贝',
			status: 'loading'			
		};
	},
	onLoad(option) {
		
		this.loadData();
		
	},



	methods: {
		//异步加载商品列表
		async loadData() {			
			await uni.request({
				url: '/wanlshop/partner/getGoods',
				data: {},
				success: res => {
					console.log(res);
				    this.goodsData = res.data; 
				}
			});
		}
		
	}
};
</script>

<style>

</style>
